package net.sf.tools.uiconfig.tags.table;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.DynamicAttributes;

import net.sf.tools.uiconfig.tags.AbstractViewTag;

public class RowTag extends AbstractViewTag implements DynamicAttributes{

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 0x1f0e601790580L;
	
	private Map<String, String> attributes = new HashMap<String, String>();
	
	public RowTag() {
		// TODO Auto-generated constructor stub
	}
	
	public void setDynamicAttribute(String arg0, String key, Object value)
			throws JspException {
		attributes.put(key.toLowerCase(), String.valueOf(value));
	}

	

	@Override
	public int doStartTag() throws JspException {
		try {
			pageContext.getOut().write(buildStartHtml(attributes));
		} catch (IOException e) {
			pageContext.getServletContext().log(e.getLocalizedMessage(), e);
		}
		
		
		return EVAL_BODY_INCLUDE;
	}

	@Override
	public int doEndTag() throws JspException {
		writeEndTag();
		return EVAL_PAGE;
	}

	
	
}
